package Employee;

use warnings;
use strict;

require Person;
our @ISA = qw (Person);

# Constructor and initialisation
sub new
{
	my ( $class, $name, $address, $phone, $salary, $position ) = @_;
	my $self = new Person( $name, $address, $phone );

	$self->{salary}   = $salary;
	$self->{position} = $position;

	bless( $self, $class );
	$self->init();

	return $self;
}

sub init
{
	my ($self) = @_;

	print "In class Employee\n";
}

# Object accessor methods

sub salary
{
	my ( $self, $salary ) = @_;
	$self->{salary} = $salary if defined $salary;
	return $self->{salary};
}

sub position
{
	my ( $self, $position ) = @_;
	$self->{position} = $position if defined $position;
	return $self->{position};
}

# Overriding Merthods

sub display
{
	my ($self) = @_;
	print "In Employee:display\n";

	$self->SUPER::display();
}

1;
